<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 构造函数方法：Array.from()
        // 将伪数组或可遍历对象转换为真正的数组

        //定义一个集合
        let arrayLike = {
            '0': 'a',
            '1': 'b',
            '2': 'c',
            length: 3
        };
        //转成数组
        let arr2 = Array.from(arrayLike); // ['a', 'b', 'c']    //Array.from()只能处理有length属性的数据
        console.log(arr2);
    </script>
</body>

</html>